{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "207b65ec",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import math\n",
    "import matplotlib.pyplot as plt\n",
    "from sympy import symbols, cos, sin\n",
    "from sympy.plotting import plot_parametric\n",
    "from math import sin,cos\n",
    "import io\n",
    "import cv2\n",
    "import pykalman\n",
    "from scipy import optimize\n",
    "import matplotlib as mpl\n",
    "from numpy import array, arange, abs as np_abs\n",
    "from numpy.fft import rfft, rfftfreq\n",
    "from math import sin, pi\n",
    "import matplotlib.pyplot as plt\n",
    "import matplotlib as mpl\n",
    "import cmath"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "46e6a53a",
   "metadata": {},
   "source": [
    "# Лабораторная работа 2.3\n",
    "Построение графиков амплитудного спектра сигнала при частоте дискретизации 5кГц"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "id": "940732d8",
   "metadata": {},
   "outputs": [],
   "source": [
    "fz = 5000\n",
    "f = 50\n",
    "A1 = 0.2\n",
    "A2 = 1\n",
    "A3 = 30\n",
    "f1 = 10\n",
    "f2 = 0.2\n",
    "f3 = 100\n",
    "t0 = 5"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f5fcdc1a",
   "metadata": {},
   "source": [
    "# Задание 1\n",
    "Функция $$ x(t) = e^{2*\\pi*I*f*t} $$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "id": "6aef3c8b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.0002\n"
     ]
    }
   ],
   "source": [
    "l = -1\n",
    "r = 1\n",
    "N = (r  - l ) *fz\n",
    "s = (r -l)/N\n",
    "print(s)\n",
    "x = []\n",
    "for i in range(N):\n",
    "    x.append(l+s*i)\n",
    "d = 1 / (r-l)\n",
    "fx = [d * p for p in range(int(-N / 2), int(N / 2))] # не включая последнюю точку"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "id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9b6d6O0fPZwKXd8huBJ7s/y033ffThO/oRVdVXq+pIt3of/dmyYGAC9Kr6NnB0AvTvT6peVa8CO4Et3aTpP05/EnWA3wH+xTK1MbKqeryqnphnU5P9DjFvbytc0wmrqnvpzxsxaAv9cwOvP0dbgM9X333Am5KcDVwF3FNVh6vqeeAeYPOSF3+CquqZqvpGt/xd4HH681c33fdRBv2J+QX6v+1h/snTNxxj/Czg7wZ+aSw4YfpJatL6hYV7a8lUVT3TLf8fYKpbPt7zfdJLshG4BLifCen7pJkc/GSQ5E+BH5ln08er6o+6fT5Of7asLyxnbUthlH41eaqqkjR533WStcAfAr9UVd/p/4Wzr+W+DfoBVfXeY21P8gHgJ4B/Xt0FO449Afp848/R/2vgKd273BWbMH1YvwtYtf0uwiRMcv/XSc6uqme6SxTPduML9X4ImJkz3luGOk9YklPph/wXqupL3XDzfYOXbkaWZDPwH4Frq+qlgU0LTYA+76Tq3S+IPfQnUYf+pOqr6d3zpPULC/S2wjWN2y765wZef452Ae/v7kJ5J/BCd6njbmBTknXdnSqburGTUvdZ0eeAx6vq1wc2Nd339630p8Gr5UH/Q8engQe7x20D2z5O/66MJ4CrB8avof/p/rfoXw45Ov5W+uG4H/h94PSV7m+efn+S/vXHV4C/Bu5uud8R/nvM29tqfAB3As8A/687xx+i/1nKnwFPAX8KnNntG+DWru+Hef0dWL/QndP9wAdXuq8hPf8zoICHBv4fvqb1vo8+/CcQJKlxXrqRpMYZ9JLUOINekhpn0EtS4wx6SWqcQS9JjTPoJalx/x9PV6FkvaQr5wAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "y = [cmath.exp(complex(2 * math.pi * f * t * 1j)) for t in  x]\n",
    "# с нормировкой по T\n",
    "d1 = abs(np.fft.fftshift(np.fft.fft(y)*s)) \n",
    "#print(d1)\n",
    "fig1 = plt.figure(1)\n",
    "axes1 = fig1.subplots(1, 1)\n",
    "axes1.plot(fx, d1, 'r')\n",
    "axes1.grid(True)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "id": "c1fcc600",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAUqklEQVR4nO3dfYxd9X3n8fdnzUMVHDUGJ1PWUExUtAvZbHiYhayySoZuYgyq8FbbqkZtQ9JEXkVht+0+iWwkqIgqJY3USlFowWosmlWK04eQuiunhDa+ZVcprE2W8LiA47SLvWxpMSUZYGFNvvvHPY4ukxnfa8+dGc/vvl/S1ZzzO+fc+/1yzGeuzz3Xv1QVkqR2/b2VLkCStLQMeklqnEEvSY0z6CWpcQa9JDXulJUuYD7r16+vjRs3rnQZx+XFF1/kjDPOWOkylpU9TwZ7Xh0eeOCBv62qN8+37aQM+o0bN7Jv376VLuO49Ho9ZmZmVrqMZWXPk8GeV4ckf7XQNi/dSFLjDHpJapxBL0mNM+glqXEGvSQ1bmjQJzk3yZ4kjyV5NMkvzrNPknwmyf4kDyW5dGDb9Ume6h7Xj7sBSdKxjXJ75RHg31XVN5K8EXggyT1V9djAPlcDF3SPK4DfAq5IciZwMzANVHfsrqp6fqxdSJIWNPQdfVU9U1Xf6Ja/CzwObJiz2xbg89V3H/CmJGcDVwH3VNXhLtzvATaPtQNpJTz4INx//0pXIY3kuL4wlWQjcAkw90/4BuDpgfWD3dhC4/M99zZgG8DU1BS9Xu94Sltxs7Ozq67mxZrknmeuvBKA3p49K1zR0pvk89yKkYM+yVrgD4FfqqrvjLuQqtoObAeYnp6u1fattNX4TbrFsmcmon/P8+o30l03SU6lH/JfqKovzbPLIeDcgfVzurGFxiVJy2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a/plt8KnNbtc1F3zO8BW7vl24CPrHR/8/R7IfAPgB4wPTDeZL9D/lss2NtqfADvBi4FHhkY+zXgxm75xoE/39cAXwECvBO4vxs/EzjQ/VzXLa9b6d6O0fPZwKXd8huBJ7s/y033ffThO/oRVdVXq+pIt3of/dmyYGAC9Kr6NnB0AvTvT6peVa8CO4Et3aTpP05/EnWA3wH+xTK1MbKqeryqnphnU5P9DjFvbytc0wmrqnvpzxsxaAv9cwOvP0dbgM9X333Am5KcDVwF3FNVh6vqeeAeYPOSF3+CquqZqvpGt/xd4HH681c33fdRBv2J+QX6v+1h/snTNxxj/Czg7wZ+aSw4YfpJatL6hYV7a8lUVT3TLf8fYKpbPt7zfdJLshG4BLifCen7pJkc/GSQ5E+BH5ln08er6o+6fT5Of7asLyxnbUthlH41eaqqkjR533WStcAfAr9UVd/p/4Wzr+W+DfoBVfXeY21P8gHgJ4B/Xt0FO449Afp848/R/2vgKd273BWbMH1YvwtYtf0uwiRMcv/XSc6uqme6SxTPduML9X4ImJkz3luGOk9YklPph/wXqupL3XDzfYOXbkaWZDPwH4Frq+qlgU0LTYA+76Tq3S+IPfQnUYf+pOqr6d3zpPULC/S2wjWN2y765wZef452Ae/v7kJ5J/BCd6njbmBTknXdnSqburGTUvdZ0eeAx6vq1wc2Nd339630p8Gr5UH/Q8engQe7x20D2z5O/66MJ4CrB8avof/p/rfoXw45Ov5W+uG4H/h94PSV7m+efn+S/vXHV4C/Bu5uud8R/nvM29tqfAB3As8A/687xx+i/1nKnwFPAX8KnNntG+DWru+Hef0dWL/QndP9wAdXuq8hPf8zoICHBv4fvqb1vo8+/CcQJKlxXrqRpMYZ9JLUOINekhpn0EtS4wx6SWqcQS9JjTPoJalx/x9PV6FkvaQr5wAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "y = [cmath.exp(complex(2 * math.pi * f * t * 1j)) for t in  x]\n",
    "# с нормировкой по членам\n",
    "d1 = abs(np.fft.fftshift(np.fft.fft(y))) \n",
    "d1*=2/N\n",
    "d1[0]/=2\n",
    "#print(d1)\n",
    "fig1 = plt.figure(1)\n",
    "axes1 = fig1.subplots(1, 1)\n",
    "axes1.plot(fx, d1, 'r')\n",
    "axes1.grid(True)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "064db64a",
   "metadata": {},
   "source": [
    "# Задание 2\n",
    "$$ x_2(t) = A_1cos(2 \\pi f_1 t) + A_2cos(2 \\pi f_2 t) + A_3cos(2 \\pi f_3 t) $$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "id": "7a01bbc5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD4CAYAAAD1jb0+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAARgElEQVR4nO3df4xldXnH8fcjsyrZXdjl1+26ki7GrSlJIzhbSmVjtiiIpClobCN/6LaSDNFqNDFpUP+oTTTRttHYSEQMq1uDoEUJpKFVJHODawp01yIurOwgamVYd0F+yNAEGHj6xz1DZpY7M3fu3B/7Pff9Sm7m3O/53rnPc8/sZ+6eOfecyEwkSeV5xbALkCR1xwCXpEIZ4JJUKANckgplgEtSocYG+WSnnHJKbtmyZZBP2RPPPPMMa9euHXYZAzNq/YI9j4pSe963b99jmXnq0eMDDfAtW7awd+/eQT5lTzSbTXbs2DHsMgZm1PoFex4VpfYcEb9qN+4uFEkqlAEuSYUywCWpUAa4JBXKAJekQi0b4BHx6oi4OyJ+EhH3RcQ/VONnRMRdEfFgRHwrIl7Z/3IlSXM6eQf+LHB+Zr4ROAu4KCLOBT4HfCEzXw88AVzetyolSS+zbIBny0x1d011S+B84MZqfDdwa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d6FIUqkMcEkqlAEuSYUywCWpUAa4JBXKAJekQhngklSo/we/di/DtVHpSQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "y = [A1*math.cos(2*math.pi * f1* t) + A2*math.cos(2*math.pi * f2* t) + A3*math.cos(2*math.pi * f3* t) for t in  x]\n",
    "# с нормировкой по T\n",
    "d1 = abs(np.fft.fftshift(np.fft.fft(y)*s)) \n",
    "#print(d1)\n",
    "fig1 = plt.figure(1)\n",
    "axes1 = fig1.subplots(1, 1)\n",
    "axes1.plot(fx, d1, 'r')\n",
    "axes1.grid(True)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "id": "bee2b6c3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD4CAYAAAD1jb0+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAARgElEQVR4nO3df4xldXnH8fcjsyrZXdjl1+26ki7GrSlJIzhbSmVjtiiIpClobCN/6LaSDNFqNDFpUP+oTTTRttHYSEQMq1uDoEUJpKFVJHODawp01yIurOwgamVYd0F+yNAEGHj6xz1DZpY7M3fu3B/7Pff9Sm7m3O/53rnPc8/sZ+6eOfecyEwkSeV5xbALkCR1xwCXpEIZ4JJUKANckgplgEtSocYG+WSnnHJKbtmyZZBP2RPPPPMMa9euHXYZAzNq/YI9j4pSe963b99jmXnq0eMDDfAtW7awd+/eQT5lTzSbTXbs2DHsMgZm1PoFex4VpfYcEb9qN+4uFEkqlAEuSYUywCWpUAa4JBXKAJekQi0b4BHx6oi4OyJ+EhH3RcQ/VONnRMRdEfFgRHwrIl7Z/3IlSXM6eQf+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AU8APgpGpuAFdVff+UhUckvb/apg8CfzPsvpbodzuQwL3z/g1fXOee59/8KL0kFWrkd6FIUqkMcEkqlAEuSYUywCWpUAa4JBXKAJekQhngklSo/we/di/DtVHpSQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# с нормировкой по членам\n",
    "d1 = abs(np.fft.fftshift(np.fft.fft(y))) \n",
    "d1*=2/N\n",
    "d1[0]/=2\n",
    "#print(d1)\n",
    "fig1 = plt.figure(1)\n",
    "axes1 = fig1.subplots(1, 1)\n",
    "axes1.plot(fx, d1, 'r')\n",
    "axes1.grid(True)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b0ff86d4",
   "metadata": {},
   "source": [
    "# Задание 3\n",
    "$$ x_3(t) =  A_1cos(2 \\pi f_1 t), если t \\leq t_0, иначе A_2cos(2 \\pi f_2 t) $$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "id": "19d7f5a3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAD4CAYAAADlwTGnAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAYfElEQVR4nO3dcYxd5X3m8e/TMXYQCcRgMsvabmyEd1WTVgYGG6krOiUJDFHWZrV2YsQG06JMm9TSrqJ264jKWblEKq3USFHdhOniBFKIoc6mTNVBLgncTbS70DHEtT2mDoOheCZO2WACGSgmDr/+cd5pz1xmPGfmXs/1nff5SFc+5z3nPff9+djzzD3n3vsqIjAzs/z8XKsHYGZmreEAMDPLlAPAzCxTDgAzs0w5AMzMMrWg1QOYiSVLlsSKFStaPYwZef311znvvPNaPYw55Zrz4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XMHxaxn98/l2M6UKjVbfiIiJM27945LejfwDeC/RcRrxYvTwnytGRwAlUTEh063XdJtwEeBD0a6IMjpJ76frP1lipeTC9JvxOX959x0NU+hrWuepdPVPF/8o6RLIuJ4utzxUmqfqvZRoLuuvTYH45wVSedQ/PC/PyL+V2qe1zWP8yWgBknqAf47sD4i3iht6gc2S1okaSWwCvhbYBBYld79spBi/uT+FByPAxtT/y1Au/2mnWPNk9bW4jE1Wz/FuYGJ56gfuDW9M+Ya4NV02WQvcL2kxendM9entrNOug91D/BMRPxxadO8rXmCVt+FbvcHxY3OY8D+9PhyadsdFO8QOQLcWGr/CMW7DZ6juKQy3n4pxQ/MYeAvgEWtrm+Kmv8TxTXOk8A/Anvne83T/H1MWls7PoCvA8eBn6ZzfDvFvZpvA88C3wIuTPsK2JnqPsjEd4T9ejqnw8Cvtbqu09T7H4AADpT+D39kPtdcfvirIMzMMuVLQGZmmXIAmJllygFgZpYpB4CZWaYcAGZmmXIAmJllygFgZpapfwbdgc47edXiUgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "y = []\n",
    "for t in x:\n",
    "    if t <= t0:\n",
    "        y.append(A1*math.cos(2*math.pi * f1* t))\n",
    "    else:\n",
    "        y.append(A2*math.cos(2*math.pi * f2* t))\n",
    "# с нормировкой по T\n",
    "d1 = abs(np.fft.fftshift(np.fft.fft(y)*s)) \n",
    "#print(d1)\n",
    "fig1 = plt.figure(1)\n",
    "axes1 = fig1.subplots(1, 1)\n",
    "axes1.plot(fx, d1, 'r')\n",
    "axes1.grid(True)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "id": "b4f82607",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAD4CAYAAADlwTGnAAAAOXRFWHRTb2Z0d2FyZ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DfAzWgq9Q+b2s+zd/FlLW14wO4FrgSOFRq+0NgW1reVvo3/hHgEUDANcCTqf1C4Gj6c3FaXtzq2qao9xLgyrT8HuD76d/xvK25/PArgAZFxN9ExKm0+gTF7GZQTHK/OyJORsTzwDCwNj2GI+JoRLwF7AY2SBJwHbAn9b8XuGmOypiRiHgmIo5Msmne1nwak9bW4jHNWkR8h2JOj7INFOcGJp6jDcB9UXgCeK+kS4AbgEcj4kREvAI8CvSc8cHPQkQcj4in0/JPgGco5i2ftzWXOQCa69cpfjuA4h9R/cT3S0/TfhHw41KYjLe3E9fcnjVMpzMijqflHwKdaXmm5/usJmkFcAXwJJnUfNZPCn82kPQt4N9MsumOiHg47XMHxaxn98/l2M6UKjVbfiIiJM27945LejfwDeC/RcRrxYvTwnytGRwAlUTEh063XdJtwEeBD0a6IMjpJ76frP1lipeTC9JvxOX959x0NU+hrWuepdPVPF/8o6RLIuJ4utzxUmqfqvZRoLuuvTYH45wVSedQ/PC/PyL+V2qe1zWP8yWgBknqAf47sD4i3iht6gc2S1okaSWwCvhbYBBYld79spBi/uT+FByPAxtT/y1Au/2mnWPNk9bW4jE1Wz/FuYGJ56gfuDW9M+Ya4NV02WQvcL2kxendM9entrNOug91D/BMRPxxadO8rXmCVt+FbvcHxY3OY8D+9PhyadsdFO8QOQLcWGr/CMW7DZ6juKQy3n4pxQ/MYeAvgEWtrm+Kmv8TxTXOk8A/Anvne83T/H1MWls7PoCvA8eBn6ZzfDvFvZpvA88C3wIuTPsK2JnqPsjEd4T9ejqnw8Cvtbqu09T7H4AADpT+D39kPtdcfvirIMzMMuVLQGZmmXIAmJllygFgZpYpB4CZWaYcAGZmmXIAmJllygFgZpapfwbdgc47edXiUgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "d1 = abs(np.fft.fftshift(np.fft.fft(y))) \n",
    "d1*=2/N\n",
    "d1[0]/=2\n",
    "#print(d1)\n",
    "fig1 = plt.figure(1)\n",
    "axes1 = fig1.subplots(1, 1)\n",
    "axes1.plot(fx, d1, 'r')\n",
    "axes1.grid(True)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a931473e",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c1198efa",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
